package com.eddie.community.dao;

import com.eddie.community.entity.Comment;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface CommentMapper {

    /**
        * Description: 查询评论
        * @params [entityType, entityId, offset, limit]
        * @return java.util.List<com.eddie.community.entity.Comment>
        * @date 2021/2/28 0028 14:42
        * @Author Eddie.Zhan
        */
    List<Comment> selectCommentsByEntity(int entityType, int entityId, int offset, int limit);

    /**
        * Description: 查询评论条数
        * @params [entityType, entityId]
        * @return int
        * @date 2021/2/28 0028 14:43
        * @Author Eddie.Zhan
        */
    int selectCountByEntity(int entityType, int entityId);

    /**
        * Description: 插入评论
        * @params [comment]
        * @return int
        * @date 2021/2/28 0028 14:43
        * @Author Eddie.Zhan
        */
    int insertComment(Comment comment);

    Comment selectCommentById(int id);

}
